#pragma once
#include "Common.h"

class Ecolor
{
public:
    int _eint = BLUE;
    const int _cint = 9; // 每个对象的地址不同
    enum Color1 {WHITE = 1, BALCK, GRAY};
private:
    enum Color2 {RED = 4, BLUE, YELLOW}; // enum类型受访问限定符的限制
};

void Test_EnumHack()
{
    Ecolor e;
    cout << e._eint << endl;
    cout << e.WHITE << endl;
    // cout << &e.WHITE << endl; // enum类型不能取地址
    cout << Ecolor::BALCK << endl; // enum类型可以通过类名作用域直接访问
    // cout << &Ecolor::BALCK << endl;
    cout << Ecolor::GRAY << endl;

    Ecolor e1, e2;
    cout << &e1._cint << endl;
    cout << &e2._cint << endl;
}
